package cumt.kydd.authoringplatform.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

import static cumt.kydd.authoringplatform.service.UserService.LoginInUser;

@Controller
public class SystemController
{

    /*
     *登录页面跳转
     */

    @GetMapping("/login")
    public String login()
    {

        return "login";
    }

    /*
     *注册页面跳转
     */

    @GetMapping("/register")
    public String register()
    {
        return "register";
    }

    /*
     *首页跳转
     */

    @GetMapping("/index")
    public String index()
    {
        return "index";
    }

    /*
     *平台页跳转
     */

    @GetMapping("/platform")
    public String platform()
    {
        return "platform";
    }

    @GetMapping("/userInfo")
    public String userInfo()
    {
        return "userInfo";
    }

    @GetMapping("/history")
    public String history(){
        return "history";
    }

    @GetMapping("/trash")
    public String trash(){
        return "trash";
    }

    @GetMapping("/help")
    public String help(){
        return "help";
    }

    @GetMapping("/exit")
    public String exit(HttpServletRequest request){
        request.getSession().removeAttribute("user");
        return "index";
    }
//    @RequestMapping(value = "/platform",method = RequestMethod.GET)
//    @ResponseBody
//    public String UserSaveData(String originalText,String summary,String title) {
//        String UserOriginalText = originalText;
//        String UserSummary = summary;
//        String UserTitle = title;
//        System.out.println("-----------------");
//        System.out.println(UserOriginalText);
//        System.out.println(UserSummary);
//        System.out.println(UserTitle);
//        return "platform";
//    }

}
